//
//  DetailTableViewCell.m
//  shanHaiHuiApp
//
//  Created by DS on 2018/3/7.
//  Copyright © 2018年 徐双. All rights reserved.
//

#import "DetailTableViewCell.h"
@interface DetailTableViewCell()

Strong UILabel * nameLabel;
Strong UILabel * contentLabel;

@end

@implementation DetailTableViewCell

- (instancetype)initWithCellIdentifier:(NSString *)cellID{
    self = [super initWithCellIdentifier:cellID];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        _nameLabel = [[UILabel alloc] init];
        _nameLabel.font = DEF_FontSize_14;
        _nameLabel.textColor = getColor(@"666666");
        _nameLabel.textAlignment = NSTextAlignmentLeft;
    
        
        _contentLabel = [[UILabel alloc] init];
        _contentLabel.font = DEF_FontSize_14;
        _contentLabel.textColor = getColor(@"323232");
        _contentLabel.textAlignment = NSTextAlignmentRight;
   
        
        [self sd_addSubviews:@[self.nameLabel,self.contentLabel]];
        
        [self layOutFrame];
    }
    return self;
}

- (void)layOutFrame{
    
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(UNIT_WIDTH(16));
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.width.mas_equalTo(UNIT_WIDTH(80));
    }];
    
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(UNIT_WIDTH(-17));
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.width.mas_equalTo(UNIT_WIDTH(250));
    }];
    
}

- (void)setModel:(NSDictionary *)model{
    _model = model;
    _nameLabel.text = model[@"title"];
    _contentLabel.text = model[@"content"];
}

@end
